class Solution {
public:
    int distributeCandies(vector<int>& candies) {
        if(candies.size()==0){return 0;}
        int n=candies.size();
        set<int> st;
        for(int i=0;i<n;i++){
            st.insert(candies[i]);
        }
        return n/2<=st.size()?n/2:st.size();
    }
};